package com.hdax.dm.controller;

import com.hdax.dm.common.utils.CommonResponse;
import com.hdax.dm.dtos.scheduler.PriceDto;
import com.hdax.dm.entity.scheduler.DmSchedulerSeatPrice;
import com.hdax.dm.service.SchedulerSeatPriceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping(path = "/scheduler")
public class GetPriceController {

    @Autowired
    private SchedulerSeatPriceService priceService;

    @PostMapping(path = "desc/getPrice")
    public CommonResponse<List<PriceDto>> getPrice(@RequestBody Map<String,Long> params){
        //获得排期编号
        Long scheduleId = params.get("scheduleId");
        return priceService.prices(scheduleId);
    }
}
